using System;
using AndyPike.Unfuddle.Contracts;

namespace AndyPike.Unfuddle.Exceptions
{
    public class InvalidEntityPropertyException : Exception
    {
        public InvalidEntityPropertyException(IEntity entity, string propertyName, object propertyValue)
            : base(string.Format("The property '{0}' of type {1} has an invalid value of '{2}'.", propertyName, entity, propertyValue))
        {
            Entity = entity;
            PropertyName = propertyName;
            PropertyValue = propertyValue;
        }

        public IEntity Entity { get; private set; }
        public string PropertyName { get; private set; }
        public object PropertyValue { get; private set; }
    }
}